<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><s:text name="system.page.title"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-1.8.0.js" charset="utf-8"></script>
<script type="text/javascript" src="js/ready.js" charset="utf-8"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	var i = <s:property value='bean.options.size()'/>;
	function editorAnswer() {
		formId.submit();
	}
	function addRow() {
		var o = $("#detail");
		var tr = $("<tr/>").addClass("detailtd").appendTo(o);
		$('<td style="width:10px"><img alt="删除" src="image/button/datagrid_row_collapse.gif" onclick="delRow(this);"/></td>').appendTo(tr);
		$('<td width="99%"><input type="text" class="input" name="bean.options['+i+'].option_name" style="width:100%;"></td>').appendTo(tr);
		i++;
	}
</script>
</head>
<body>
<div class="tools">
	<div class="tool">
	<ul>
		<li>
			<div onclick="editorAnswer()"><img src="image/button/filesave.png" width="20" height="20"/><span><s:text name='system.button.save'/></span></div>
		</li>
		<li>
			<div><img src="image/button/ABORT20.gif"/><span><s:text name='system.button.channel'/></span></div>
		</li>
	</ul>
	</div>
</div>
<s:form action="editorAnswer.do" id="formId" name="formId">
<s:hidden name="bean.answer_id"/>
<s:hidden name="parent_code"/>
<div class="formatClass">
	<div class="formatData">
		<div class="formatTitle"><span><s:text name='rec.answer'/></span></div>
		<div class="formatTable" style="height:100%;">
			<table border="0" cellpadding="0" cellspacing="0" width="100%" class="formatTable">
				<tr>
					<th><s:text name='rec.answer.answer_name'/></th>
					<td><s:textfield name="bean.answer_name" cssStyle="width:190px;"/></td>
				</tr>
				<tr>
					<th><s:text name='rec.answer.answer_type'/></th>
					<td>
						<s:select list="@net.common.manager.DictManager@getValues('0002')" name="bean.answer_type" value="bean.answer_type" listKey="dict_num" listValue="dict_name"></s:select>
					</td>
				</tr>
				<tr>
					<th><s:text name='rec.answer.answer_rule'/></th>
					<td>
						<s:select list="@net.common.manager.DictManager@getValues('0003')" name="bean.answer_rule" value="bean.answer_rule" listKey="dict_num" listValue="dict_name" ></s:select>
					</td>
				</tr>
				<tr>
					<th><s:text name='rec.answer.input_type'/></th>
					<td>
						<s:select list="@net.common.manager.DictManager@getValues('0004')" name="bean.input_type" value="bean.input_type" listKey="dict_num" listValue="dict_name"></s:select>
					</td>
				</tr>
			</table>
		</div>
		<div class="formatTitle"><span><s:text name='rec.option'/></span></div>
		<div class="y-scroll" style="height:181px;">
			<table border="0" cellpadding="0" cellspacing="0"  class="listdetail" id="detail">
				<tr class="trhead">
					<td style="width:10px"><img alt="添加" src="image/button/datagrid_row_expand.gif" onclick="addRow();"/></td>
					<td width="99%"><s:text name='rec.option.option_name'/></td>
				</tr>
				<s:set name="seq" value="0"/>
				<s:iterator value="bean.options" id="o">
					<tr class="detailtd">
						<td style="width:10px"><img alt="添加" src="image/button/datagrid_row_expand.gif" onclick="delRow(this);"/></td>
						<td width="99%"><input type="text" class="input" name="bean.options[<s:property value="#seq"/>].option_name" style="width:100%;" value="<s:property value="#o.option_name"/>"></td>
					</tr>
					<s:set name="seq" value="#seq+1"/>
				</s:iterator>
			</table>
		</div>
	</div>
</div>
</s:form>
</body>
</html>